import fetch from 'common/src/utils/fetch';
import baseUrl from './env';
// 录入列表
function getEntryList(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntryUnder/getList`,
      method: 'post',
      data
  });
}
// 删除录入模板
function deleteTemplate(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntryUnder/deleteSyllabusById`,
      method: 'post',
      data
  });
}
// 录入获取模板
function getTemplate(data) {
  return fetch({
      url: `${baseUrl}/templateManagementUndergraduate/previewTemplateByTime`,
      method: 'get',
      data
  });
}
// 录入保存/提交
function entryAddSyllabus(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntryUnder/saveSyllabus`,
      method: 'post',
      data
  });
}
// 编辑保存/提交
function entryUpdataSyllabus(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntryUnder/editSyllabus`,
      method: 'post',
      data
  });
}
// 从已审核完成数据来的 编辑保存/提交
function adminEditSyllabus(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntryUnder/adminEditSyllabus`,
      method: 'post',
      data
  });
}
// 根据id查数据
function getTemplateById(id) {
  return fetch({
      url: `${baseUrl}/syllabusEntryUnder/getSyllabusById?id=${id}`,
      method: 'get'
  });
}
// 复制 根据code获取已审核教学大纲
function getSyllabusByCode(id) {
  return fetch({
      url: `${baseUrl}/syllabusEntryUnder/getSyllabusByCode?code=${id}`,
      method: 'get'
  });
}
// 编辑提交
function submitWorkFlow(data) {
  return fetch({
      url: `${baseUrl}/underApprove/submitWorkFlow`,
      method: 'post',
      data
  });
}
// 课程负责人（模糊查询接口）
function findTeacherList(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntryUnder/findTeacherList`,
      method: 'post',
      data
  });
}
// 批量导出
function batchExport(data) {
  return fetch({
      url: `${baseUrl}/file/batchExport`,
      method: 'post',
      data
  });
}
/**
* 获取key
*/
function exportStatus(key) {
  return fetch({
      url: `${baseUrl}/file/result/${key}`,
      method: 'get',
  });
}

// 获取课程号（模糊查询接口）
function getCourse(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntryUnder/getCourse`,
      method: 'post',
      data
  });
}

// 获取课程信息（模糊查询接口）
function getInfoByPar(data) {
  return fetch({
      url: `${baseUrl}/syllabusEntryUnder/getInfoByPar`,
      method: 'post',
      data
  });
}
const undergraduateEntryApi = {
  getEntryList,
  deleteTemplate,
  getTemplate,
  entryAddSyllabus,
  adminEditSyllabus,
  entryUpdataSyllabus,
  getTemplateById,
  getSyllabusByCode,
  submitWorkFlow,
  findTeacherList,
  batchExport,
  exportStatus,
  getCourse,
  getInfoByPar
}
export default undergraduateEntryApi;
